/* 频道相关接口 */
import axios from '@/utils/request'

/**
 * 获取我的频道数据
 * @returns
 */
export function getUserChannels() {
  return axios({
    url: '/v1_0/user/channels'
  })
}

/**
 * 获取所有频道数据
 * @returns
 */
export const getChannels = () =>
  axios({
    url: '/v1_0/channels'
  })

/**
 *设置用户频道
 * @param {*} channels item 类型: object
 * @returns
 */
export const setUserChannels = (channels) => {
  return axios({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels
    }
  })
}
/**
 * 删除频道接口
 * @param {*} target 用户id
 * @returns
 */
export const delUserChannels = (target) => {
  return axios({
    method: 'DELETE',
    url: '/v1_0/user/channels/' + target
  })
}
